﻿<?xml version="1.0" encoding="utf-8"?>

<Mapping xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

  <Entity type="NUnit:Mapping:RelationshipToAbstractClass:Zoo" table="Zoo">

    <Id field="Id">
      <Generator name="guid" />
    </Id>

    <Reference name="Inhabitants" entityChild="NUnit:Mapping:RelationshipToAbstractClass:Inhabitant">
      <Rule parentField="Id" childTable="Inhabitant" childField="FK_Zoo" />
    </Reference>

    <Reference name="Inhabitants" entityChild="NUnit:Mapping:RelationshipToAbstractClass:Human">
      <Rule parentField="Id" childTable="Human" childField="FK_Zoo" />
    </Reference>

    <Reference name="Inhabitants" entityChild="NUnit:Mapping:RelationshipToAbstractClass:Dog">
      <Rule parentField="Id" childTable="Dog" childField="FK_Zoo" />
    </Reference>
    
  </Entity>

  <Entity type="NUnit:Mapping:RelationshipToAbstractClass:Inhabitant" table="Inhabitant">
    <Id field="Id">
      <Generator name="guid" />
    </Id>

    <Attribute name="Name" field="FName" db-type="String" size="50" scale="0" precision="0" not-null="false" />

  </Entity>
  
  <Entity type="NUnit:Mapping:RelationshipToAbstractClass:Dog" table="Dog" copyNode="NUnit:Mapping:RelationshipToAbstractClass:Inhabitant">

    <Id field="Id">
      <Generator name="guid" />
    </Id>

    <Attribute name="Kind" field="Kind" db-type="String" size="50" scale="0" precision="0" not-null="false" />

  </Entity>

  <Entity type="NUnit:Mapping:RelationshipToAbstractClass:Human" table="Human" copyNode="NUnit:Mapping:RelationshipToAbstractClass:Inhabitant">

    <Id field="Id">
      <Generator name="guid" />
    </Id>

    <Attribute name="LastName" field="LastName" db-type="String" size="50" scale="0" precision="0" not-null="false" />

  </Entity>

</Mapping>